<?php
$seo = YSEO::getSEO("{$node_name},{$model->keywords}", $model->name);
$this->pageTitle = $seo['title'];
$this->pageKeywords = $seo['keywords'];
$this->pageDescription = $seo['description'];

$this->breadcrumbs = array(
    $node_name => array('products/index', 'node' => $model->node_id),
    $model->name,
);
?>


<div id="box_large">
    <div id="top">
        <?php echo $node_name; ?>
    </div>
    <div id="body">
        <div id="body_main">
            <!-- body -->
            <div class="product_details row">
                <div class="name"><?php echo $model->name; ?></div>
                <div class="other">
                    <?php echo '发布于 ' . date('Y-m-d', $model->created); ?>
                    <span></span>
                    浏览次数: <?php echo $model->clicks_count; ?>
                </div>

                <div class="row">
                    <div class="thumbnail">
                        <?php echo CHtml::image($model->thumbnailSource, CHtml::encode($model->name) , array('width' => 500, 'height' => 500)); ?>
                    </div>
                    <div class="params">
                        <ul>
                            <li><span>市场价格：</span><?php echo $model->market_price; ?></li>
                            <li><span>市场价格：</span><?php echo $model->member_price; ?></li>
                        </ul>
                    </div>
                </div>

                <div class="summary row">
                    <?php
                    $this->beginWidget('CMarkdown', array('purifyOutput' => true));
                    echo $model->summary;
                    $this->endWidget();
                    ?>
                </div>
            </div>

            <div id="comments">
                <?php if($model->commentCount>=1): ?>
                <h3>
                        <?php echo $model->commentCount>1 ? $model->commentCount . ' comments' : 'One comment'; ?>
                </h3>

                    <?php $this->renderPartial('_comments', array(
                        'post' => $model,
                        'comments' => $model->comments,
                    )); ?>
                <?php endif; ?>

                <h3>提交评论：</h3>

                <?php if(Yii::app()->user->hasFlash('commentSubmitted')): ?>
                <div class="success">
                        <?php echo Yii::app()->user->getFlash('commentSubmitted'); ?>
                </div>
                <?php else: ?>
                    <?php $this->renderPartial('/productComments/_form',array(
                        'model'=>$comment,
                    )); ?>
                <?php endif; ?>
            </div><!-- comments -->
            <!-- // body -->
        </div>
    </div>
</div>